package com.hmall.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.order.Order;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Date;

public interface OrderMapper extends BaseMapper<Order> {

    /**
     * @param orderId
     * @param date
     * @return void
     * 更新订单的状态为交易失败，更新订单的交易关闭时间
     */
    @Update("update `tb_order` set `status`= 5,`close_time`= #{date} where `id`= #{orderId}")
    void updateOrderById(Long orderId, Date date);
}
